#include <bits/stdc++.h>
using namespace std;
map<int,int> mp;
int main()
{
 ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int n; cin >>n;
  vector<int> arr(n);
  int i=0;
  for(i=0;i<n;i++)
  {
    cin >>arr[i];
    mp[arr[i]]++;
  }
  int count=0;
  for(auto &a:mp)
  {
    if(a.first<a.second) count+=a.second-a.first;
    else if(a.first>a.second) count+=a.second;
  }
  cout <<count<<endl;
  return 0;
}
